package cn.gok.hotelback.controller;

import cn.gok.hotelback.entity.RoomNumber;
import cn.gok.hotelback.service.RoomNumberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;

@RestController
@RequestMapping("/roomnumber")
public class RoomNumberController {
    @Autowired
    private RoomNumberService roomNumberService;

    /**
     * 根据房型查找空闲房间
     */
    @GetMapping("/freeByType")
    public List<RoomNumber> freeByType(@RequestParam Integer roomTypeId) {
        return roomNumberService.findFreeByType(roomTypeId);
    }
} 